package com.example.myproject.config;
import com.turn.ttorrent.tracker.Tracker;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

@Component
public class TrackerStarter implements CommandLineRunner {

    private final TrackerHolder trackerHolder;

    public TrackerStarter(TrackerHolder trackerHolder) {
        this.trackerHolder = trackerHolder;
    }

    @Override
    public void run(String... args) {
        Tracker tracker = trackerHolder.getTracker();
        System.out.println("Tracker obtained: " + tracker);
    }
}

